using System;
using System.Data;
using System.Data.SqlClient;
using LibreriaCommon;
using LibreriaData;
using Microsoft.Practices.EnterpriseLibrary.Data;
using SistemaControlTraficoLibDS;

namespace SistemaControlTraficoLibData
{
    public class daMovil : daMovilBase, IDisposable
    {
        public daMovil(SecurityInfo securityInfo) : base(securityInfo)
        {
        }

        public DataSet FindByFiltros(string movilNumero, string movilPatente, int tipoMovilID, Nullable<decimal> movilCostoHora, Nullable<decimal> movilCostoHoraPeon, object estado, object movilPropio)
        {
            try
            {
                DataSet ds = new DataSet();
                daCommon.GenericFind(securityInfo, "MovilFindByFiltros", ds, new string[] { "Movil" }, movilNumero, movilPatente, tipoMovilID, movilCostoHora, movilCostoHoraPeon, estado, movilPropio);
                return ds;
            }
            catch (Exception ex)
            {
                throw new daException(ex);
            }
        }
        public DataSet FindByDisponibles()
        {
            try
            {
                DataSet ds = new DataSet();
                daCommon.GenericFind(securityInfo, "MovilDisponible", ds, new string[] { "Movil" });
                return ds;
            }
            catch (Exception ex)
            {
                throw new daException(ex);
            }
        }

        public DataSet FindByDisponiblesByTipo(int tipoMovilID)
        {
            try
            {
                DataSet ds = new DataSet();
                daCommon.GenericFind(securityInfo, "MovilDisponibleByTipo", ds, new string[] { "Movil" }, tipoMovilID);
                return ds;
            }
            catch (Exception ex)
            {
                throw new daException(ex);
            }
        }

        public DataSet FindByFaltante()
        {
            try
            {
                DataSet ds = new DataSet();
                daCommon.GenericFind(securityInfo, "MovilFaltante", ds, new string[] { "Movil" });
                return ds;
            }
            catch (Exception ex)
            {
                throw new daException(ex);
            }
        }
    }
}

